define(
    ["PDUtilDir/grid", "PDUtilDir/searchBlock", "PDUtilDir/slidebar"],
    function (Grid, SearchBlock, Slidebar) {

        function init(cache, searchObj) {
            SearchBlock.init('searchSystemLogBlockId');
            // 初始化
            return Grid({
                id: "SystemLogGirdDivId",
                pageSize: 10,
                index: true,
                multi: true,
                pagination: true,
                cache: false,
                layout: [
                    {
                        name: "IP",
                        field: "ipdz",
                        sort: true,
                        width: '100px',
                        click: function (e) {
                            detailObj.run(e.data.row.id);
                        }
                    }, {
                        name: "服务地址",
                        field: "serviceName",
                        sort: true
                    }, {
                        name: "异常",
                        field: "flag",
                        width: '60px',
                        sort: true,
                        format: function (e) {
                            return e.row.flag == 1 ? '是':'否';
                        }
                    }, {
                        name: "开始调用时间",
                        field: "startTime",
                        width: '140px',
                        sort: true
                    }, {
                        name: "结束调用时间",
                        width: '140px',
                        field: "endTime",
                        sort: true
                    }, {
                        name: "耗时",
                        width: '60px',
                        field: "msel",
                        sort: true
                    }, {
                        name: "操作",
                        field: "createTime",
                        sort: false,
                        width: '60px',
                        format: function (e) {
                            return '<a href="javascript:angular.element(\'#SystemLogGirdDivId\').scope().detailSupport.run(\'' + e.row.id + '\')">明细</a>';
                        }
                    }],
                toolbar: [{
                    name: "查询",
                    icon: "fa fa-search",
                    callback: function (event) {
                        searchObj.run();
                    }
                }],
                data: {
                    type: 'URL',
                    value: getServer()
                    + '/flea/hclv/syslog/getAllExceptionPaging.htmls'
                }
            });
        }

        return {
            init: init
        }
    });